JSONArraySetValue

Sets or adds the value to an index in a JSONArray and returns the modified array.

Syntax

JSONArraySetValue("JSON", Index, "Value")

Arguments

Argument Description
JSON JSONArray.
Index Index in the JSONArray. Indexes are zero based.
Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

Return value

Value Description
Value Modified JSONArray.

Example

' Returns "[1,2,3]"

strVal = JSONArraySetValue("[1,2]", 2, 3)

PrintLn("Should be \"[1,2,3]\": " & strVal)